﻿using System.IO;

namespace CopyDirectory
{
    public class Program
    {
        private const string SourceDirectory = @"C:\games\Blip Blop";
        private const string DestinationDirectory = @".\Copied";

        private static void CopyDirectory(DirectoryInfo sourceDir, DirectoryInfo destinationDir)
        {
            string source = sourceDir.FullName + Path.DirectorySeparatorChar;
            string destination = destinationDir.FullName + Path.DirectorySeparatorChar;
            foreach (FileInfo file in sourceDir.GetFiles())
            {
                File.Copy(source + file.Name, destination + file.Name, true);
            }
            foreach (DirectoryInfo dir in sourceDir.GetDirectories())
            {
                Directory.CreateDirectory(destination + dir.Name);
                CopyDirectory(dir, new DirectoryInfo(destination + dir.Name));
            }
        }

        public static void Main()
        {
            if (Directory.Exists(DestinationDirectory))
            {
                Directory.Delete(DestinationDirectory, true);
            }
            Directory.CreateDirectory(DestinationDirectory);
            CopyDirectory(new DirectoryInfo(SourceDirectory), new DirectoryInfo(DestinationDirectory));
        }
    }
}
